package client_gui;

import javax.swing.JFrame;

import net.miginfocom.swing.MigLayout;

import javax.swing.JLabel;
import javax.swing.JTextField;
import javax.swing.JButton;


/**
 * 
 * @author notebook
 *@param 
 */
public class ClientGui extends JFrame{
	private JTextField ip;
	private JTextField port;
	public JButton btnConnect;

	
	
	public String getIp() {
		return ip.getText();
		//return "localhost";
	}



	public int getPort() {
		return Integer.parseInt(port.getText());
		//return 3333;
	}



	public ClientGui() {
		//getContentPane().setSize(400, 400);
		setBounds(100, 100, 450, 300);
		getContentPane().setLayout(new MigLayout("", "[][][grow]", "[][][]"));
		setLocationRelativeTo(null);
		JLabel lblIp = new JLabel("IP");
		getContentPane().add(lblIp, "cell 1 0,alignx trailing");
		
		ip = new JTextField();
		getContentPane().add(ip, "cell 2 0,growx");
		ip.setColumns(10);
		
		JLabel lblPort = new JLabel("Port");
		getContentPane().add(lblPort, "cell 1 1");
		
		port = new JTextField();
		getContentPane().add(port, "cell 2 1,growx");
		port.setColumns(10);
		
		btnConnect = new JButton("Connect");

		getContentPane().add(btnConnect, "cell 2 2");
	}
	
}

